package com.zs.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/error")
public class ErrorController {

    @GetMapping("data1")
    public String error1() {
        System.out.println("ErrorController.error1");
        String name = null;
        name.toString();
        return "null point exception !!!";
    }
    @GetMapping("data2")
    public String error2() {
        System.out.println("ErrorController.error2");
        int a = 1;
        int b = 0;
        int c = a / b;
        return "ArithmeticException !!!";
    }
    @GetMapping("data3")
    public String data3() {
        System.out.println("ErrorController.error3");
        return "success";
    }
}
